import * as React from "react";
import Card from "../components/card";
import Button from "../components/button";
import ListGroup from "../components/listGroup";
import { List } from "immutable";

type Function = "localGame";

interface HomeProps {
    onFunctionSelected: (func: Function) => void
}

export class Home extends React.Component<HomeProps> {
    render() {
        const item = <Button
            classNames={["home-main-function-item"]}
            text='Hello World'
            onClicked={_ => this.props.onFunctionSelected("localGame")} />;
        const items = List([item]);

        return (
            <div className="home">
                <Card classNames={["w-50"]} id="home-main-function-card">
                    <ListGroup items={items} />
                </Card>
            </div>
        )
    }
}
